package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.heart.service.IOrderDeliveryService;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.OrderDeliveryMapper;
import com.ly.heart.domain.OrderDeliveryEntity;

import javax.annotation.Resource;

/**
 * 采购订单交货安排Service业务层处理
 *
 * @author cxl
 * @date 2024-06-06
 */
@Service
public class OrderDeliveryServiceImpl extends ServiceImpl<OrderDeliveryMapper,OrderDeliveryEntity> implements IOrderDeliveryService {

    @Resource
    private OrderDeliveryMapper orderDeliveryMapper;

    /**
     * 查询采购订单交货安排
     *
     * @param id 采购订单交货安排ID
     * @return 采购订单交货安排
     */
    @Override
    public OrderDeliveryEntity selectOrderDeliveryEntityById(String id)
    {
        return orderDeliveryMapper.selectOrderDeliveryEntityById(id);
    }

    /**
     * 查询采购订单交货安排列表
     *
     * @param orderDeliveryEntity 采购订单交货安排
     * @return 采购订单交货安排
     */
    @Override
    public List<OrderDeliveryEntity> selectOrderDeliveryEntityList(OrderDeliveryEntity orderDeliveryEntity)
    {
        return orderDeliveryMapper.selectOrderDeliveryEntityList(orderDeliveryEntity);
    }

    /**
     * 新增采购订单交货安排
     *
     * @param orderDeliveryEntity 采购订单交货安排
     * @return 结果
     */
    @Override
    public int insertOrderDeliveryEntity(OrderDeliveryEntity orderDeliveryEntity)
    {
        orderDeliveryEntity.setCreateTime(DateUtils.getNowDate());
        return orderDeliveryMapper.insertOrderDeliveryEntity(orderDeliveryEntity);
    }

    /**
     * 修改采购订单交货安排
     *
     * @param orderDeliveryEntity 采购订单交货安排
     * @return 结果
     */
    @Override
    public int updateOrderDeliveryEntity(OrderDeliveryEntity orderDeliveryEntity)
    {
        return orderDeliveryMapper.updateOrderDeliveryEntity(orderDeliveryEntity);
    }

    /**
     * 批量删除采购订单交货安排
     *
     * @param ids 需要删除的采购订单交货安排ID
     * @return 结果
     */
    @Override
    public int deleteOrderDeliveryEntityByIds(String[] ids)
    {
        return orderDeliveryMapper.deleteOrderDeliveryEntityByIds(ids);
    }

    /**
     * 删除采购订单交货安排信息
     *
     * @param id 采购订单交货安排ID
     * @return 结果
     */
    @Override
    public int deleteOrderDeliveryEntityById(String id)
    {
        return orderDeliveryMapper.deleteOrderDeliveryEntityById(id);
    }
}
